home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ABUSESRC.ZIP / AbuseSrc / macabuse / imlib / include / packet.hpp < prev    next >
C/C++ Source or Header  |  1997-05-20  |  726b  |  33 lines

  1. #ifndef __PACKET_HPP_
  2. #define __PACKET_HPP_
  3. #include "macs.hpp"
  4. class packet
  5. {
  6.   public :
  7.   uchar *buf;
  8.   long buf_size,ro,wo,rend;
  9.   int pre_size;
  10.   void make_bigger(int max);
  11.  
  12.   int get_read_position() { return ro; }
  13.   void set_read_position(int x) { ro=x; }
  14.   int read(uchar *buffer, int size);
  15.   int write(uchar *buffer, int size);
  16.   int eop() { return ro>=rend; }
  17.   void reset();
  18.   packet(int prefix_size=2);
  19.   void get_string(char *st, int len);
  20.   int advance(long offset);
  21.  
  22.   void write_long(ulong x);      // writes can't fail...
  23.   void write_short(ushort x);
  24.   void write_byte(uchar x);
  25.   void insert_into(packet &pk);
  26.   int size() { return rend-pre_size; }
  27.   ~packet();
  28. } ;
  29.  
  30.  
  31.  
  32. #endif
  33.